package com.szrt.java.day20161227.demo04;

import java.util.Arrays;

import org.junit.Test;

public class ArrayDeleteTest03 {

	@Test
	public void del(){
		
		int[] olds = new int[]{5,8,4,9,2,1};
		
		int indexDel = 4;
		
		int length = olds.length;
		int[] news = new int[olds.length-1];
		
		for(int index =0;index<indexDel;index++){
			int value = olds[index];
			news[index] = value;
		}
		
		for(int index =indexDel;index<length;index++){
			int value = olds[index];
			news[index-1] = value;
		}
		System.out.println(Arrays.toString(olds));
		System.out.println(Arrays.toString(news));
		
	}
	
}
